package com.bdqn.feign;

import com.bdqn.base.R;
import com.bdqn.feign.fallback.FeignAuthServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * FeignPaymentService
 *
 * @author LILIBO
 * @since 2023-03-09
 */
@Component // 该类必须以组件的形式添加到Spring容器中才能生效，最常用的方式就是在类上标注@Component注解
@FeignClient(name = "cloud-auth-service", fallback = FeignAuthServiceFallback.class)
public interface FeignAuthService {

    /**
     * 远程调用 认证模块进行Token验证
     *
     * @param token 验证的Token
     * @return 验证是否成功
     */
    @PostMapping("/auth/verify")
    R verify(@RequestBody String token);
}
